﻿using Shop.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Shop.MVC.Areas.Admin.Controllers
{
    public class OrderController : Controller
    {
        OrderManager orderManager=new OrderManager();
        // GET: Admin/Order
        public ActionResult Index(int state=-1,int pageIndex=1)
        {
            int count;
            var list= orderManager.GetOrderList(state,pageIndex,out count);
            ViewBag.Total = count;
            ViewBag.Index = pageIndex;
            ViewBag.State = state;
            return View(list);
        }

        public ActionResult Send(int id)
        {
            orderManager.ChangeOrderState(id, 2);
            return RedirectToAction("Index");
        }
    }
}